<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>props= (ChainETL)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File etl/std.rb, line 133</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">props=</span>(<span class="ruby-identifier">chain_config</span>)
    <span class="ruby-identifier">verbose_log</span> <span class="ruby-node">&quot;Configuring chain #{@name} ...&quot;</span>
    <span class="ruby-ivar">@props</span> = <span class="ruby-identifier">chain_config</span>
    <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
    <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">chain_config</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">token</span> = <span class="ruby-identifier">chain_config</span>[<span class="ruby-node">&quot;block#{i}&quot;</span>] <span class="ruby-keyword kw">do</span>
        <span class="ruby-identifier">etlclass</span> , <span class="ruby-identifier">etlname</span> = <span class="ruby-identifier">token</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;,&quot;</span>).<span class="ruby-identifier">reject</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span> <span class="ruby-operator">==</span> <span class="ruby-value str">''</span> }
        <span class="ruby-identifier">etl</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-node">&quot;#{etlclass}.new&quot;</span>)
        <span class="ruby-identifier">etl</span>.<span class="ruby-identifier">name</span> = <span class="ruby-identifier">etlname</span> <span class="ruby-operator">||</span> <span class="ruby-node">&quot;#{@name}_#{i}_#{etlclass}&quot;</span>
      
        <span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">etl</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:global_opts=</span>))
          <span class="ruby-identifier">etl</span>.<span class="ruby-identifier">global_opts</span> = <span class="ruby-ivar">@opts</span>
        <span class="ruby-keyword kw">end</span>
        <span class="ruby-identifier">etl</span>.<span class="ruby-identifier">props</span> = <span class="ruby-identifier">resolve_props</span>(<span class="ruby-ivar">@opts</span>[<span class="ruby-identifier">etl</span>.<span class="ruby-identifier">name</span>])
        <span class="ruby-ivar">@blocks</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">etl</span>
        <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
      <span class="ruby-keyword kw">end</span>    
    <span class="ruby-keyword kw">end</span>
    <span class="ruby-identifier">verbose_log</span> <span class="ruby-node">&quot;Chain #{@name} has #{length} blocks in it&quot;</span>
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>